<!DOCTYPE html>
<html lang="en">
  <head>
  	<?php $settings = AdminSettings::first(); ?>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="<?php echo $settings->description; ?>">
    <meta name="keywords" content="<?php echo $settings->keywords; ?>" />
    <link rel="shortcut icon" href="<?php echo URL::asset('public/img/favicon.ico'); ?>" />

    <title><?php echo Lang::get('auth.join'); ?> - <?php echo $settings->title; ?></title>

    <?php echo $__env->make('includes.css_general', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

  </head>

  <body id="join-section">
     
     <?php echo $__env->make('includes.navbar', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    
    
<!-- Start CONTAINER -->
<div class="container wrap-ui">
	<!-- ROW -->
	<div class="row">
        
     	<!-- Col MD -->
<div class="col-md-12">	
	
	<div class="row">
		
		<div class="col-md-12">
			
			<h3 class="text-center join-title"><?php echo Lang::get('auth.join'); ?> - <?php echo $settings->title; ?></h3>
			<h4 class="text-center join-title"><?php echo Lang::get('auth.already_have_an_account'); ?> <a href="login" class="btn btn-xs btn-success no-shadow font-default btn-join margin-zero"><?php echo Lang::get('auth.sign_in_nav'); ?></a></h4>
		
			
		<div class="login-form">
			<?php if(Session::has('notification')): ?>
			<div class="alert alert-success btn-sm margin-zero" role="alert">
            		<?php echo Session::get('notification'); ?>

            		</div>
            	<?php endif; ?>
          	<form action="<?php echo URL::to('join-team'); ?>" method="post" name="form" id="signup_form">
           
            <div class="form-group">
              <input type="text" class="form-control login-field" value="<?php echo Input::old('team_name'); ?>" name="team_name" id="team_name" placeholder="<?php echo Lang::get('auth.team_name'); ?>" title="<?php echo Lang::get('auth.team_name'); ?>" autocomplete="off">
              <label class="login-field-icon fui-user" for="team_name"></label>
              
              <?php if( $errors->first("team_name") ): ?>
              <div class="alert alert-danger btn-sm margin-top-alert" role="alert">
            		<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            		<strong><?php echo $errors->first("team_name"); ?></strong>
            		</div>
            	<?php endif; ?>
              
            </div>
            
            <div class="form-group">
              <input type="text" class="form-control login-field" value="<?php echo Input::old('username'); ?>" name="username" id="username" placeholder="<?php echo Lang::get('auth.username'); ?>" title="<?php echo Lang::get('auth.username'); ?>" autocomplete="off">
              <label class="login-field-icon fui-user" for="username"></label>
              
              <?php if( $errors->first("username") ): ?>
              <div class="alert alert-danger btn-sm margin-top-alert" role="alert">
            		<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            		<strong><?php echo $errors->first("username"); ?></strong>
            		</div>
            	<?php endif; ?>
              
            </div>
            
            <div class="form-group">
              <input type="text" class="form-control login-field" value="<?php echo Input::old('email'); ?>" name="email" id="email" placeholder="<?php echo Lang::get('auth.email'); ?>" title="<?php echo Lang::get('auth.email'); ?>" autocomplete="off">
              <label class="login-field-icon fui-mail" for="email"></label>
              
              <?php if( $errors->first("email") ): ?>
              <div class="alert alert-danger btn-sm margin-top-alert" role="alert">
            		<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            		<strong><?php echo $errors->first("email"); ?></strong>
            		</div>
            	<?php endif; ?>
            	
            </div>
            
            <div class="form-group">
              <input type="password" class="form-control login-field" name="password" id="password" placeholder="<?php echo Lang::get('auth.password'); ?>" title="<?php echo Lang::get('auth.password'); ?>" autocomplete="off">
              <label class="login-field-icon fui-lock" for="password"></label>
            
            <?php if( $errors->first("password") ): ?>
              <div class="alert alert-danger btn-sm margin-top-alert" role="alert">
            		<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            		<strong><?php echo $errors->first("password"); ?></strong>
            		</div>
            	<?php endif; ?>
            </div>
        
        <?php if( $settings->captcha == 'on' ): ?>    
            <div class="form-group">
              <input type="text" class="form-control login-field" name="captcha" id="lcaptcha" placeholder="" title="">
              <label class="login-field-icon fui-lock" for="lcaptcha"></label>
            
              <div class="alert alert-danger btn-sm margin-top-alert" id="errorCaptcha" role="alert" style="display: none;">
            		<strong><?php echo Lang::get('auth.error_captcha'); ?></strong>
            		</div>
            </div>
            <?php endif; ?>
                     
           <button type="submit" id="buttonSubmit" class="btn btn-block btn-lg btn-success col-thumb"><?php echo Lang::get('auth.pay_register'); ?></button>
							
    	<label class="text-center">
		   <span class="label-terms"><?php echo Lang::get('auth.terms'); ?></span>
		</label>

          </form></div>
			
		</div><!-- /COL MD -->
		
	</div><!-- /Row -->
    	
 </div><!-- /COL MD -->
    	
</div><!-- /Row -->

    </div> <!-- /container -->
    
    <?php echo $__env->make('includes.javascript_general', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    
    <script type="text/javascript">
 
 <?php if( $settings->captcha == 'on' ): ?>     
/*
 *  ==============================================  Captcha  ============================== * /
 */
   var captcha_a = Math.ceil( Math.random() * 5 );
   var captcha_b = Math.ceil( Math.random() * 5 );
   var captcha_c = Math.ceil( Math.random() * 5 );
   var captcha_e = ( captcha_a + captcha_b ) - captcha_c;
  
function generate_captcha( id ) {
	var id = ( id ) ? id : 'lcaptcha';
	$("#" + id ).html( captcha_a + " + " + captcha_b + " - " + captcha_c + " = ").attr({'placeholder' : captcha_a + " + " + captcha_b + " - " + captcha_c, title: 'Captcha = '+captcha_a + " + " + captcha_b + " - " + captcha_c });
}
$("input").attr('autocomplete','off');
generate_captcha('lcaptcha');

$('#buttonSubmit').click(function(e){
   	e.preventDefault();
   	var captcha        = $("#lcaptcha").val();
    	if( captcha != captcha_e ){
				var error = true;
		        $("#errorCaptcha").fadeIn(500);
		        $('#lcaptcha').focus();
		        return false;
		      } else {
		      	$(this).css('display','none');
		      	$('#signup_form').submit();
		      }
    });
    
    <?php else: ?>
    
    $('#buttonSubmit').click(function(e){

		$(this).css('display','none');
    });
    
    <?php endif; ?>
    
    
    $('#full_name').focus();
    
    <?php if(Session::has('notification')): ?>
    	$('#signup_form').remove();
    <?php endif; ?>

    // Tooltip
    $('.shotTooltip').tooltip();
    
    </script>
    
  </body>
</html>